<template>
  <!-- 我的金融方案-->
  <page-loading :show="showPage">
    <view class="content">
      <view class="myFpbox" v-if="pageskulist.length>0" v-for="(item, index) in pageskulist" :key="index">
        <view class="setAsDefault flex flex-jc-sb flex-ai-c">
          <view class="flex flex-ai-c">
            <view class="safText">
              设为默认方案
            </view>
            <view class="safXuaz" @click="switcclick(item,index)">
              <u-switch v-model="item.is_Default" active-color="#41CB05" inactive-color="#E1E1E1" size="24"></u-switch>
            </view>
          </view>
          <view class="edit" @click="editclick(item)">
            编辑
          </view>
        </view>
        <view class="schemeboxTyp flex">
          <view class="typebosx flex">
            <view class="sname">
              {{getType(item.loanPlan_Type)}}
            </view>
            <view class="stype">
              {{item.name}}
            </view>
          </view>
          <view @click="cheCllickz(item,index)">
            <i-icon v-show="!item.chekdfalse" icon="icongou" type="single" size="40rpx" color="#999999"></i-icon>
            <i-icon v-show="item.chekdfalse" icon="icongouxuan" type="multiple" size="40rpx"></i-icon>
          </view>
        </view>
        <!-- rowspan="5" -->
        <view class="formbox" :class="item.upfloclick ? 'formbox' : 'formboxcss'">
          <view class="">
            <table class="tabborder">
              <tr class="trborder">
                <td class="trborder heads trw3">首付比例</td>
                <td class="trborder heads trw3">贷款期数</td>
                <td class="trborder heads trw1">万元系数</td>
                <td class="trborder heads trw0">金融手续费</td>
              </tr>
            </table>
          </view>
          <view>
            <table class="tabborder" v-for="(item1, dfdfs) in item.planList" :key="dfdfs">
              <tr class="trborder" v-for="(item2,indexsd) in item1.loanPlan_PlanList" :key="indexsd">
                <td class="trborder trw3">{{item2.proportion}}</td>
                <td class="trborder trw3">{{item2.loanPeriods}}</td>
                <td class="trborder trw2">
                  <view class="flex flex-ai-c" v-if="item2.monthly">
                    <view>
                      {{item2.interestRate}}
                    </view>
                    <view class="monthlys flex flex-ai-c">
                      <view class="sanj"></view>
                      <view class="moncss">
                        月供:{{item2.monthly}}
                      </view>
                    </view>
                  </view>
                  <text v-else>{{item2.interestRate}}</text>
                </td>
                <td class="trborder trw0">
                  <text v-if="item2.poundage">{{item2.poundage}}</text>
                  <text v-else>/</text>
                </td>
              </tr>
            </table>
          </view>
        </view>
        <!-- 展开 -->
        <view v-if="item.planTotal >1">
          <view class="unfoldbox flex flex-jc-c" v-show="item.upfloclick" @click="upClick(index)">
            <view class="Unfold">
              {{item.zhankai}}
            </view>
            <view class="jiantou">
              <u-icon name="arrow-down" color="#9A9A9A" size="24rpx"></u-icon>
            </view>
          </view>
        </view>
        <!-- 收起 -->
        <view class="unfoldbox flex flex-jc-c" v-show="!item.upfloclick" @click="upClick(index)">
          <view class="Unfold">
            {{item.zhankai}}
          </view>
          <view class="jiantou">
            <u-icon name="arrow-up" color="#9A9A9A" size="24rpx"></u-icon>
          </view>
        </view>
      </view>
      <view class="defaultMap" v-if="defaultMap">
        <image src="https://files.yzsheng.com/bussiness/imgs/tu@2x.png"></image>
        <view class="texna">
          还没有添加金额方案
        </view>
      </view>
      <u-gap height="97" bg-color="#F6F6F6"></u-gap>
      <view class="newFinancialSolution" @click="newFinanSClick">
        新增金融方案
      </view>
    </view>
  </page-loading>
</template>

<script src="./myFinancialPlan.js"></script>
<style lang="scss" scoped>
  @import './myFinancialPlan.scss';
</style>
